home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGNG_C
/
ADVC10.LZH
/
EQUIPMNT.C
< prev
next >
Wrap
Text File
|
1987-02-07
|
2KB
|
85 lines
int commports() /* get number of serial ports */
{
union REGS inregs;
union REGS outregs;
int86(0x11,&inregs,&outregs);
return((outregs.h.ah & 15) >> 1);
}
int displaytype() /* get display type */
{
union REGS inregs;
union REGS outregs;
inregs.h.ah = 15;
int86(0x10,&inregs,&outregs);
return((outregs.h.al != 7));
}
char getdrive() /* get default drive */
{
return((bdos(0x19,0,0) & 255)+'A');
}
int joystick() /* see if there's a joystick */
{
union REGS inregs;
union REGS outregs;
int86(0x11,&inregs,&outregs);
return((outregs.h.ah >> 4) & 1);
}
int limmfree() /* get free pages of expanded memory */
{
int freemem = 0;
union REGS inregs;
union REGS outregs;
inregs.h.ah = 0x42;
int86(0x67,&inregs,&outregs);
if (!outregs.h.ah) freemem = outregs.x.bx;
return(freemem);
}
int limmtotal() /* get total pages of expanded memory */
{
int totalmem = 0;
union REGS inregs;
union REGS outregs;
inregs.h.ah = 0x42;
int86(0x67,&inregs,&outregs);
if (!outregs.h.ah) totalmem = outregs.x.dx;
return(totalmem);
}
int printports() /* get number of parallel ports */
{
union REGS inregs;
union REGS outregs;
int86(0x11,&inregs,&outregs);
return(outregs.h.ah >> 6);
}
int totalmem() /* get Kbytes of installed RAM */
{
union REGS inregs;
union REGS outregs;
int86(0x12,&inregs,&outregs);
return(outregs.x.ax);
}